home *** CD-ROM | disk | FTP | other *** search
/ Hot Metal Pro 4.0 / Hot Metal Pro 4.0.iso / HMPTools / VRCreate / data.z / Click - Disappear.beh < prev    next >
Encoding:
Text File  |  1997-05-19  |  1.8 KB  |  67 lines

  1. #VRML V2.0 utf8 - PLATINUM technology, inc. 1997
  2. #ADD_TOUCH_SENSOR
  3. #MOVE_OBJ_UNDER_SWITCH
  4.  
  5. DEF $OBJECT_Switch Switch
  6. {
  7.   whichChoice 1
  8.   choice
  9.   [
  10.     DEF $OBJECT_SwitchTransform Transform 
  11.     {
  12.       children
  13.       [
  14.     Shape
  15.     {
  16.         appearance Appearance {
  17.                                 material Material {
  18.                                     specularColor 1 1 1
  19.                                     diffuseColor 0.8 0.8 0.8
  20.                                     shininess 0.2
  21.                                 }
  22.                             }
  23.  
  24.         geometry Cone
  25.         {}
  26.     }
  27.       ]    
  28.     }
  29.   ]
  30. }
  31.  
  32. DEF $OBJECT_SwitchAndMove_pos PositionInterpolator {
  33.                             key [0 0.51 1 ]
  34.                             keyValue [ 0 0 0  -1.468 0 -4.168  -5.382 0 -18.82 ]
  35.                         }
  36.  
  37. DEF $OBJECT_SwitchTimer TimeSensor {
  38.                             enabled TRUE
  39.                             startTime 0.0
  40.                             stopTime 1.0
  41.                             cycleInterval 5
  42.                             loop TRUE
  43.                         }
  44.  
  45.  
  46.  
  47. DEF $OBJECT_SwitchAndMoveScr Script 
  48. {
  49.     eventIn        SFTime    clicked                    # Object Click event
  50.     eventOut    SFTime    startTimer                # startTime for Timer
  51.     eventOut    SFInt32 choice                    # switch choiceeventOut    SFVec3f moveObject                # move initial object
  52.  
  53.   url "vrmlscript:
  54.      function clicked (value) 
  55.      {
  56.     choice = -1;   
  57.     startTimer = value;  
  58.      }
  59. "
  60. }
  61.  
  62.  
  63. ROUTE $OBJECTTS.touchTime TO $OBJECT_SwitchAndMoveScr.clicked
  64. ROUTE $OBJECT_SwitchAndMoveScr.choice  TO $OBJECT_Switch.set_whichChoice
  65. ROUTE $OBJECT_SwitchAndMoveScr.startTimer TO $OBJECT_SwitchTimer.set_startTime
  66. ROUTE $OBJECT_SwitchTimer.fraction_changed  TO $OBJECT_SwitchAndMove_pos.set_fraction
  67. ROUTE $OBJECT_SwitchAndMove_pos.value_changed TO $OBJECT_SwitchTransform.set_translation